package com.guigu.www.controller.yinBo;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.guigu.www.dao.bean.TSetmealCheckgroup;
import com.guigu.www.service.TSetmealCheckgroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 套餐检查分组关联表 前端控制器
 * </p>
 *
 * @author abo
 * @since 2021-06-17
 */
@RestController
@CrossOrigin
@RequestMapping("/tSetmealCheckgroup")
public class TSetmealCheckgroupController {

    @Autowired
    TSetmealCheckgroupService tSetmealCheckgroupService;


    /*去关联表中找到需要的setmealId*/
    @GetMapping("/{setmealId}")
    public List q(@PathVariable("setmealId") int id){
        List list=new ArrayList();
        List<TSetmealCheckgroup> setmeal_id = tSetmealCheckgroupService.selectList(new EntityWrapper<TSetmealCheckgroup>().eq("setmeal_id", id));
        for(TSetmealCheckgroup t : setmeal_id){
            list.add(t.getCheckgroupId());
        }
        /*Wrapper wrapper= new EntityWrapper<TSetmealCheckgroup>();
        wrapper.in("",list);*/
        return  list;
    }
}

